package my.design.enjoy;

/**
 * @author zp
 * @version 1.0
 * @description: 具体享元类
 * @date 2022/10/15 15:32
 */
public class PowerBank extends BasePowerBankFlyWeight{

    /**
     * 编号
     */
    private Integer id;

    /**
     * 品牌
     */
    private String brand;

    public PowerBank(Integer id, String brand) {
        this.id = id;
        this.brand = brand;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    @Override
    public void use(User user) {
        System.out.println("编号：" + id + " 品牌：" + brand + " 的充电宝正在被"+user.getName()+"用户使用中……");
        this.inUse = true;
    }

    @Override
    public void endUse(User user) {
        System.out.println("编号：" + id + " 品牌：" + brand +"的充电宝被用户"+ user.getName()+" 使用结束，已放回……");
        this.inUse = false;
    }
}

